const Product = require("../../model/client/Product");

module.exports = {
  async list(req, res) {
      let rec = req.query;
      let data = await Product.list(rec.page, rec.count, rec.type, rec.order);

      if(data.code == 200) {
        res.success("获取成功", data.data);
      }else {
          res.error(data.msg);
      }
  },
  async detail(req, res) {
    let id = req.params.id;
    let data = await Product.detail(id);

    if(data.code == 200) {
        res.success("获取成功", data.data);
    }else {
        res.error(data.msg);
    }
  }
};
